﻿<Page
    x:Class="XamlCropControl.WinRT.Sample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:XamlCropControl.WinRT.Sample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:xamlcrop="using:XamlCropControl"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock
            Text="CropControl Test"
            Style="{StaticResource PageHeaderTextStyle}" />

        <Border Grid.Row="1" BorderBrush="Red" BorderThickness="1">
            <xamlcrop:CropControl x:Name="Crop" ImageSource="ms-appx:///Assets/wrench.jpg" DesiredAspectRatio="1.0" />
        </Border>

        <Grid Grid.Row="2" HorizontalAlignment="Right">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>

            <TextBlock Text="Left:" Grid.Column="0" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding CropLeft,ElementName=Crop}" Grid.Column="1" Margin="0,0,10,0" />
            <TextBlock Text="Top:" Grid.Column="2" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding CropTop,ElementName=Crop}" Grid.Column="3" Margin="0,0,10,0" />

            <TextBlock Text="Right:" Grid.Column="0" Grid.Row="1" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding CropRight,ElementName=Crop}" Grid.Column="1" Grid.Row="1" Margin="0,0,10,0" />
            <TextBlock Text="Bottom:" Grid.Column="2" Grid.Row="1" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding CropBottom,ElementName=Crop}" Grid.Column="3" Grid.Row="1" Margin="0,0,10,0" />

            <TextBlock Text="Crop Width:" Grid.Column="0" Grid.Row="2" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding CropWidth,ElementName=Crop}" Grid.Column="1" Grid.Row="2" Margin="0,0,10,0" />
            <TextBlock Text="Crop Height:" Grid.Column="2" Grid.Row="2" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding CropHeight,ElementName=Crop}" Grid.Column="3" Grid.Row="2" Margin="0,0,10,0" />

            <TextBlock Text="Aspect Ratio:" Grid.Column="2" Grid.Row="3" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding ActualAspectRatio,ElementName=Crop}" Grid.Column="3" Grid.Row="3" Margin="0,0,10,0" />

            <TextBlock Text="Original Width:" Grid.Column="0" Grid.Row="4" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding OriginalWidth,ElementName=Crop}" Grid.Column="1" Grid.Row="4" Margin="0,0,10,0" />
            <TextBlock Text="Original Height:" Grid.Column="2" Grid.Row="4" Margin="0,0,10,0" HorizontalAlignment="Right" />
            <TextBlock Text="{Binding OriginalHeight,ElementName=Crop}" Grid.Column="3" Grid.Row="4" Margin="0,0,10,0" />

        </Grid>
    </Grid>
</Page>
